#include "process.h"

typedef void (*callback_t)(double,double);

double total = 1024.0;
double speed = 1.0;

void Download(callback_t cb)
{
    double current = 0;
    while(current <= total)
    {
        cb(total,current);
        current += speed;
        usleep(3000);
    }
    printf("\ncomplete%.2lfMB!\n",total);
}

void Upload(callback_t cb)
{
    double current = 0;
    while(current <= total)
    {
        cb(total,current);
        current += speed;
        usleep(3000);
    }
    printf("\ncomplete%.2lfMB!\n",total);
}

int main()
{
    process_v1(); 
    Upload(process_v2);
    Download(process_v2);

    return 0;
}
